﻿@{
    ViewBag.Title = "setAdvs";
}

@section scripts
{
    <link href="~/Scripts/miniui/themes/default/large-mode.css" rel="stylesheet" type="text/css" />       
    <script src="@Url.Content("~/Scripts/shared/share.js")" type="text/javascript"></script> 
    <script src="@Url.Content("~/Scripts/shared/shown.js")" type="text/javascript"></script>
}
<form id="form1" method="post">
        @Html.Partial("~/Views/Modular/Toolbars.cshtml")

        <div name="Base" title="会员资料" style="height:100%;overflow:hidden;margin-top:15px;margin-left:25px;">
            <table style="border-collapse: collapse;">
                <tr >
                    <td width="120px" height ="40px" align="right" style="font-size:11pt;">主屏广告网址：</td>
                    <td width="400px" height ="40px">
                        <input name="FAdvUrl" id="FAdvUrl" class="mini-textbox" style="width:400px;" value="" TabIndex="1" selectOnFocus="true"/>
                    </td>
                </tr>
                <tr>
                    <td width="120px" height ="40px" align="right" style="font-size:11pt;">是否启用：</td>
                    <td width="400px" height ="40px">
                        <input id="FAdvUrlFlag" name="FAdvUrlFlag" class="mini-combobox" style="width:400px;" showNullItem="false" 
                            allowInput="false" align="left" value ="1" data ="comState" tabindex="2"/> 
                    </td>
                </tr>
            </table>
        </div>
</form>

<script>
    var comState = [{ "id": "1", "text": "启用" }, { "id": "0", "text": "禁用" }];
    var jsonID = "";
    mini.parse();
    function FormShown() {
        mini.getbyName("FAdvUrl").focus();
    };
    function SetInfoData(data) {
        jsonID = data.Json;
        mini.getbyName("FAdvUrl").setValue(data.data.FAdvUrl);
        mini.get("FAdvUrlFlag").setValue(data.data.FAdvUrlFlag);
    }

    function SaveInfo() {
        var form = new mini.Form("#form1");
        var data = form.getData(true, false);
        data.CorpIDs = jsonID;
        var json = mini.encode(data);
        $.post("setAdv", { mjson: json,  mSystemAppID: parent.window.getSystemAppID() }, function (data) {
            var ret = mini.decode(data);
            if (ret.status == 1) {
                mini.showTips({ content: ret.msg, state: "success", x: "center", y: "top", timeout: 3000 });
            }
            else {
                mini.alert("" + ret.error);
            }
        });
    }

</script>